#ifndef inboxListData_H_
#define inboxListData_H_
#include <QtCore>
#include <QtXml>
#include <iostream>
using namespace std;
class smsData{
	public:
		QString type;
		QString content;

		bool isAvailable(){
			if(type.length()!=0 && 
					content.length()!=0)
				return true;
			else
				return false;
		}
};
typedef QList<smsData> messageList;

class inboxData{
	public:
		QString phoneNum;
		messageList mMessageList;
//		messageList mTrushList;	
		bool isAvailable(){
			if(phoneNum.length()!=0)
				return true;
			else
				return false;
		}
};
typedef QList<inboxData> inboxList;

class inboxListData : public QObject{
	Q_OBJECT
	public:
		inboxListData(QString xmlFileName);
		inboxList mInboxList;
		void saveinboxXml();
		void loadinboxXml();
		void setDataChanged();
		int findPhoneNum(QString &str);
		void insertMessage(QString &phoneNum, smsData &data);
		bool delMessage(QString &phoneNum, int index);
	private:
		QString xmlFile;
	public:
	signals:
		void dataChanged();
};
#endif
